@echo off
if {%2} =={} goto setlog

SET LogFile=%2
goto exe

:setlog
set LogFile=logs\run_%db2_server_name%.log

:exe
echo [%1] is loading on [%db2_server_name%] and logged in [%LogFile%]
echo [%1] is loading on [%db2_server_name%] and logged in [%LogFile%] >> %LogFile%

echo --------------------- execute file:%1-------------------- >> %LogFile%
db2 values(current time) >> %LogFile%
db2 -td@ -f %1 -z %LogFile%
db2 values(current time) >> %LogFile%


if {%3}=={/I} goto end

pause

:end
